<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>Chapter01</title>
	<script>
	function Lecture(name, teacher) {
		this.name = name;
		this.teacher = teacher;
	}

	Lecture.prototype.display1 = function() {
		return this.teacher + " is teaching " + this.name;
	};

	function Schedule(lectures) {
		this.lectures = lectures;
	}

	Schedule.prototype.display = function() {
		var str = "";

		for (var i = 0; i < this.lectures.length; i++) {
			str += this.lectures[i].display1() + "\n";
		}
		return str;
	};

	var mySchedule = new Schedule([
		new Lecture("Gym", "Mr.Smith"),
		new Lecture("Math", "Mrs.Jones"),
		new Lecture("English", "TBD")
	]);

	console.log(mySchedule.display());
	</script>
</head>
<body>
	
</body>
</html>